package net.csdn.business.common.config;

import io.jaegertracing.internal.MDCScopeManager;
import io.opentracing.contrib.java.spring.jaeger.starter.JaegerAutoConfiguration;
import io.opentracing.contrib.java.spring.jaeger.starter.TracerBuilderCustomizer;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName SysLogConfig
 * @Description TODO
 * @Author zhangyl
 * @Date 2023/4/19 13:36
 */
@Configuration
@AutoConfigureBefore({JaegerAutoConfiguration.class})
public class SysLogConfig {
    @Bean
    public TracerBuilderCustomizer mdcBuilderCustomizer() {
        // 1.8新特性，函数式接口
        return builder -> builder.withScopeManager(new MDCScopeManager.Builder().build());
    }

}
